package com.asman.vr.dto

import androidx.annotation.MainThread
import com.asman.vr.network.Api
import com.asman.vr.network.RequestBody
import com.asman.vr.network.liveData
import java.util.concurrent.Executor

class SchemeRepository(private val api: Api, private val networkExecutor: Executor) {

    @MainThread
    fun searchSchemeList(buildingName: String?) = liveData(api.searchSchemeList(buildingName))

    @MainThread
    fun getHomeDataFilterHotBuildings() = liveData(api.getHomeDataFilterHotBuindings())

    @MainThread
    fun getHomeDataFilterStyleLists() = liveData(api.getHomeDataFilterStyleLists())

    @MainThread
    fun getWholeSchemeList() = liveData(api.getWholeSchemeList())

    @MainThread
    fun getSchemeList(homeDataFilter: RequestBody.HomeDataFilterRequest) = liveData(
        api.getHomeDataList(homeDataFilter)
    )

    @MainThread
    fun getOnLineHotDesigner() = liveData(api.getOnLineHotDesigner())

    @MainThread
    fun getSchemeInfo(schemeId: Long) = liveData(api.getSchemeInfo(schemeId))

    @MainThread
    fun getSchemeInfoDetail(schemeId: Long, vrType: Int?) =
        liveData(api.getSchemeInfoDetail(schemeId, vrType))

    /**
     * 基础装修 报价数据
     * @param schemeId 方案ID
     * @param partType 1软装  2 硬装
     */
    @MainThread
    fun getHardSoftPriceInfo(schemeId: Long, partType: Int) =
        liveData(api.getHardSoftPriceInfo(schemeId, partType))

    @MainThread
    fun getDecorateBaseInfo(schemeId: Long) = liveData(api.getDecorateBaseInfo(schemeId))

    @MainThread
    fun getGoodsDecorateData(request: RequestBody.DecorateRequest) =
        liveData(api.getGoodsDecorateData(request))

    @MainThread
    fun updateDecorateGoods(request: RequestBody.DecorateUpdateGoodsRequest) =
        liveData(api.updateDecorateGoods(request))

}